/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package ADT;
import Interfaces.*;

/**
 *
 * @author markusbaisch
 */
public class Values implements Value {
    // Konstanten
    static final int ZERO = 0;
    static final double ZERO_MASS = 0.0;
    static final double FEET_IN_METERS = 0.3048;
    static final double KILO = 1000.;

    // Factory-Methoden
    public Values(){};
    public static Length LengthInM(double length){ return LengthImpl.valueOf( length ); }
    public static Mass MassInKG(double mass){ return MassImpl.valueOf(mass); }
    public static BoundingBox boundingBox( Length length, Length width, Length height) { return BoundingBoxImpl.valueOf(length, width, height); }
    public static BoundingBox boundingBox( double length, double width, double height) { return BoundingBoxImpl.valueOf(LengthImpl.valueOf(length), LengthImpl.valueOf(width), LengthImpl.valueOf(height) ); }
    public static Name name(String TheName) { return NameImpl.valueOf(TheName);}
    public static UniqueId id(long id) { return UniqueIdImpl.valueOf(id); }
    public static StowageLocation stowageLocation(int bay, int row, int tier) { return StowageLocationImpl.valueOf(bay,row,tier);}

    // HashDouble
    protected static int hashDouble(double val) {
        long longBits = Double.doubleToLongBits(val);
        return (int) (longBits ^ (longBits >>> 32));
    }
}
